home *** CD-ROM | disk | FTP | other *** search
- class classes.bro.RapidLaser
- {
- var x;
- var y;
- var id;
- var dir;
- var clip;
- var axis;
- var w;
- var h;
- var power;
- var exploX;
- var exploY;
- var xMov = 0;
- var yMov = 0;
- function RapidLaser(px, py, pDir, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.dir = pDir;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("rapidLaser","rapidLaser" + this.id + "Clip",_root.d + 5000);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.id = this.id;
- if(this.dir == "U")
- {
- this.axis = "y";
- this.yMov = -25;
- this.xMov = _root.randRange2(-2,2);
- this.y += 25;
- }
- else if(this.dir == "D")
- {
- this.axis = "y";
- this.yMov = 25;
- this.xMov = _root.randRange2(-2,2);
- this.y -= 25;
- }
- else if(this.dir == "R")
- {
- this.axis = "x";
- this.yMov = _root.randRange2(-2,2);
- this.xMov = 25;
- this.x -= 25;
- }
- else
- {
- this.axis = "x";
- this.yMov = _root.randRange2(-2,2);
- this.xMov = -25;
- this.x += 25;
- }
- this.clip.gotoAndStop(this.dir);
- this.w = this.clip._width;
- this.h = this.clip._height;
- this.power = _root.laserPower;
- if(this.power > 8)
- {
- this.clip.body.gotoAndPlay("boosted");
- }
- _root.stats.fired = _root.stats.fired + 1;
- }
- function hit()
- {
- _root.stats.hit = _root.stats.hit + 1;
- _root.createGunExplo([this.exploX,this.exploY,_root.randRange2(50,80)]);
- _root.removeBroShot("rapidLaser" + this.id);
- }
- function main()
- {
- this[this.axis + "Mov"] *= 1.03;
- if(this.x > 1075 || this.x < -75 || this.y > 675 || this.y < -75)
- {
- _root.removeBroShot("rapidLaser" + this.id);
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-